<?php

namespace common\services\myhtsq;


use common\services\BaseService;
use common\repositories\myhtsq\ContractApiLogRepository;
use common\support\LogHelper;



/**
 * Description of RevenueService
 * 日志管理服务
 * @author zhoud01
 */
class LogService extends BaseService
{

    public $_errorLog;
    protected $_contractApiLogRepository;
    public function __construct(contractApiLogRepository $contractRevenueRepository,$config = [])
    {
        $this->_contractApiLogRepository = $contractRevenueRepository;

        $logConfig = [
            'logFile' => \Yii::$app->getRuntimePath() . '/logs/base/contract.log', // 日志文件路径配置
        ];
        $this->_errorLog = new LogHelper($logConfig);

        parent::__construct($config);
    }

    /**
     * 写入日志
     * @param $contractApiLogModel
     * @return bool
     */
    public function addContractApiLogRecord($contractApiLogModel)
    {
        return ContractApiLogRepository::addContractApiLogRecord($contractApiLogModel);
    }


}
